package pl.edu.agh.anomalyids.network.header.impl;

import pl.edu.agh.anomalyids.network.header.Header;

public class IPv4Header implements Header {

	private static final long serialVersionUID = 1L;
	
	private String srcAddress;
	private String destAddress;
	private int TTL;
	
	public String getSrcAddress() {
		return srcAddress;
	}
	
	public void setSrcAddress(String srcAddress) {
		this.srcAddress = srcAddress;
	}
	
	public String getDestAddress() {
		return destAddress;
	}
	
	public void setDestAddress(String destAddress) {
		this.destAddress = destAddress;
	}

	public int getTTL() {
		return TTL;
	}

	public void setTTL(int tTL) {
		TTL = tTL;
	}
	
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		
		builder.append("======= IPv4 ======\n");
		builder.append("Source address: ");
		builder.append(getSrcAddress());
		builder.append("\n");
		builder.append("Destination address: ");
		builder.append(getDestAddress());
		builder.append("\n");
		builder.append("Time to live: ");
		builder.append(getTTL());
		builder.append("\n");
		
		return builder.toString();	
	}
	
	@Override
	public String getName() {
		return "IPv4";
	}
}
